package com.dk.service.impl;

import com.dk.mapper.TPersonMapper;
import com.dk.pojo.TPerson;
import com.dk.pojo.TPersonExample;
import com.dk.service.LogenServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service //dubbo生产者暴露接口 alibaba包
public class LogenServiceImpl implements LogenServiceI {

    @Autowired
    private TPersonMapper tPersonMapper;

    @Override
    public TPerson listGet(String pname) {
        TPersonExample tPersonExample =new TPersonExample();
        TPersonExample.Criteria criteria = tPersonExample.createCriteria();
        criteria.andPnameEqualTo(pname);
        List<TPerson> list = tPersonMapper.selectByExample(tPersonExample);
        return (list == null || list.size() <= 0) ? null : list.get(0);
    }
}
